package com.example.demo.service;

import com.example.demo.entity.QuestionsOptions;
import com.example.demo.entity.TestQuestions;
import com.example.demo.utils.R;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface QuestionsService {

    /**
     * 查询章节试题
     * */
    public List<TestQuestions> selsectlist(Integer chapter_id);
    public TestQuestions selsect(Integer test_questions_id);
    public List<QuestionsOptions> selopts(Integer test_questions_id);

    /**
     * 查询试卷题目
     * */
    public String seltpque(Integer cid);
//    public int seltpqueid(Integer cid);//找到试卷ID
    public List selpptid(Integer cid);//找到试卷对应的题目ID
    public String seltqname(Integer tqid);//找到试卷名称
    public List selqops(Integer tqid);//找到题目选项

    /**
     * 查询所有试题
     * */
    public List<TestQuestions> selquestion(Integer page,Integer limit);
    public List<TestQuestions> selquestion1();
    public int selquenums();
    public List<TestQuestions> selmuhu(String test_questions_name,Integer test_questions_picture,Integer test_questions_history);

    //查询试题答案
    public List<QuestionsOptions> selqueopt(Integer test_questions_id);
    //增加试题答案
    public int inserqueopt(Integer test_questions_id,String questions_options_content,Integer questions_options_type);
    //删除试题答案
    public int delqueopt(Integer test_questions_id);

    /**
     * 查询试题ID
     * */
    public int selque(String name);
    /**
     * 增加试题
     * */
    public int insertquestion(String test_questions_name,Integer test_questions_difficulty,Integer test_questions_language,Integer test_questions_picture,Integer test_questions_history,Integer test_questions_score);
    /**
     * 增加章节试题
     * */
    public int insertpaperques(Integer test_paper_id,Integer test_questions_id);

    /**
     * 增加试卷试题
     * */
    public int inspques(Integer cid,Integer tqid);

    /**
     * 查询试卷是否有相同的题
     * */
    public int selspques(Integer cid,Integer tqid);
    /**
     * 更改试题
     * */
    public int updatetestques(String test_questions_name,Integer test_questions_difficulty,Integer test_questions_picture,Integer test_questions_history,Integer test_questions_score,Integer test_questions_id);
    /**
     * 删除试题
     * */
    public int deleteques(Integer test_questions_id);//删除试题
    int delcques(Integer test_questions_id);//删除章节试题
    int selcques(Integer test_questions_id);//查询章节试题
    int delpicques(Integer test_questions_id);//删除图片
    int selpicques(Integer test_questions_id);//查询图片
    /**
     * 删除章节试题
     * */
    public int delsecques(Integer chapter_id,Integer paper_question_id);

    /**
     * 上传试题图片
     * */
    public int intpic(String question_picture_name,String question_picture_address,Integer test_questions_id);

    //文件存后台
    public R upload(MultipartFile file, Integer test_questions_id);

    /**
     * 查询是否正确答案
     * */
    public int seloptty(Integer questions_options_id);

    /**
     * 更改试题选项
     */
    public int upoptionall(Integer qoid);
    public int upoption(String qocent,Integer qotype,Integer qoid,Integer tqid);

    /**
     * 增加章节试题
     */
    int selcqion(Integer cid,Integer qid);//查询试题是否重复
    int inscqion(Integer cid,Integer qid);//增加章节试题

    /**
     * 查询章节试题
     */
    List<Integer> selcqus(Integer cid);//查询试题ID
    List<TestQuestions> seltqnm(Integer tqid);//查询试题题目

    /**
     * 查询试题图片
     * @param tqid
     * @return
     */
    List selqucpic(Integer tqid);

}
